package com.example.baselibs.utils;

import android.content.Context;
import android.content.Intent;

public class ShareUtil {
    public static void share(Context context,String shareContent){
        Intent shareIntent=new Intent();
        shareIntent.setAction(Intent.ACTION_SEND);
        shareIntent.putExtra(Intent.EXTRA_TEXT, shareContent);
        shareIntent.setType("text/plain");
        //设置分享列表的标题，并且每次都显示分享列表
        try {
            context.startActivity(Intent.createChooser(shareIntent, "分享到"));
        } catch (Exception ex) {
            ActivityUtils.showToast(context,"未安装分享应用!");
        }
    }
}
